<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>督查管理-督查列表-部门情况列表-督查评分</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="/overseer_assets/details_assets/css/bootstrap.min.css" rel="stylesheet">
	<link href="/overseer_assets/details_assets/css/style.css" rel="stylesheet">
	<link href="/overseer_assets/details_assets/css/font-awesome.css" rel="stylesheet">
    <link rel="stylesheet" href="/plugins/SweetAlert/sweetalert.css" />
</head>

<body>
	<div class="container-fluid">
		<div class="om-ctl-mes">
			<div class="title">
				<div class="col-xs-12"><span class="fa fa-list-ul"> 督查管理</span><b class="fa fa-caret-right"></b><i>督查列表</i><b class="fa fa-caret-right"></b><i>部门情况列表</i><b class="fa fa-caret-right"></b><i>督查评分</i></div>
			</div>
			<div class="seltemple">
				<p>卫生评分</p>
			</div>
			
           
            <div class="personset-content col-xs-12">
                <div id="personset-tab-list" class="tab-title">
                   <span>卧室卫生</span>
                   <span>厨房卫生</span>
                   <span>卫生间卫生</span>
              </div>
              <div id="personset-tab-content">
              	   <!-- 卧室 -->
                  <div>
                  <table class="table off-table">
	              <thead>
	             	<tr>
			        <th>项目</th>
			        <th>考核内容</th>
			        <th>评分标准</th>
			        <th>分值</th>
			        <th>扣分</th>
		            </tr>
	              </thead>
	             <tbody>
                <?foreach($tDatas['居室环境'] as $tRow1){?>
                <form data="1" method="post" action="/admin_overseer/overadd">
                    <input type="hidden" name="status" value="1">
                    <input type="hidden" name="depa" value="<?=$pDepartment?>">
		           <tr>
                   <td><?=$tRow1['exam_title']?></td>
                   <td><?=$tRow1['exam_content']?></td>
                   <td><?=$tRow1['exam_stand']?></td>
                   <td><?=$tRow1['exam_score']?></td>
                   <td><?if(array_key_exists('pingfen',$tRow1)){?><?=(empty($tRow1['pingfen'])?0:$tRow1['pingfen']).'分';?><?}else{?><select name="sum[<?=$tRow1['id']?>]"><?for($i=0;$i<=$tRow1['exam_score'];$i++){?><option value="<?=$i?>"><?=$i?></option><?}?></select><?}?></td>
                   </tr>
                <?}?>
	            </tbody>
              </table>
                <?if(!array_key_exists('pingfen',$tRow1)){?><button type="button" data="1" style="float:right;width:100px;" class="btn btn-default">提交</button><?}?>
                </form>
                  </div>
                  <!-- 厨房 -->
                  <div>
                  <table class="table off-table">
	              <thead>
	             	<tr>
			        <th>项目</th>
			        <th>考核内容</th>
			        <th>评分标准</th>
			        <th>分值</th>
			        <th>扣分</th>
		            </tr>
	              </thead>
                <?foreach($tDatas['厨房环境'] as $tRow2){?>
                <form data="2" method="post" action="/admin_overseer/overadd">
                    <input type="hidden" name="status" value="2">
                    <input type="hidden" name="depa" value="<?=$pDepartment?>">
		           <tr>
                   <td><?=$tRow2['exam_title']?></td>
                   <td><?=$tRow2['exam_content']?></td>
                   <td><?=$tRow2['exam_stand']?></td>
                   <td><?=$tRow2['exam_score']?></td>
                   <td><?if(array_key_exists('pingfen',$tRow2)){?><?=(empty($tRow2['pingfen'])?0:$tRow2['pingfen']).'分';?><?}else{?><select name="sum[<?=$tRow2['id']?>]"><?for($i=0;$i<=$tRow2['exam_score'];$i++){?><option value="<?=$i?>"><?=$i?></option><?}?></select><?}?></td>
                   </tr>
                <?}?>
	            </tbody>
              </table>
                <?if(!array_key_exists('pingfen',$tRow2)){?><button type="button" data="2" style="float:right;width:100px;" class="btn btn-default">提交</button><?}?>
                </form>
                  </div>
                  <!-- 卫生间 -->
                  <div>
                     <table class="table off-table">
	              <thead>
	             	<tr>
			        <th>项目</th>
			        <th>考核内容</th>
			        <th>评分标准</th>
			        <th>分值</th>
			        <th>扣分</th>
		            </tr>
	              </thead>
	             <tbody>
	             <tbody>
                <?foreach($tDatas['卫生间环境'] as $tRow3){?>
                    <form method="post" action="/admin_overseer/overadd" data="3">
                    <input type="hidden" name="status" value="3">
                    <input type="hidden" name="depa" value="<?=$pDepartment?>">
		           <tr>
                   <td><?=$tRow3['exam_title']?></td>
                   <td><?=$tRow3['exam_content']?></td>
                   <td><?=$tRow3['exam_stand']?></td>
                   <td><?=$tRow3['exam_score']?></td>
                   <td><?if(array_key_exists('pingfen',$tRow3)){?><?=(empty($tRow3['pingfen'])?0:$tRow3['pingfen']).'分';?><?}else{?><select name="sum[<?=$tRow3['id']?>]"><?for($i=0;$i<=$tRow3['exam_score'];$i++){?><option value="<?=$i?>"><?=$i?></option><?}?></select><?}?></td>
                   </tr>
                <?}?>
	            </tbody>
              </table>
                <?if(!array_key_exists('pingfen',$tRow3)){?><button type="button" data="3" style="float:right;width:100px;" class="btn btn-default">提交</button><?}?>
                </form>
                  </div>
               </div>

		</div>
    </div>
        <script type="text/javascript" src="/overseer_assets/details_assets/js/jquery.min.js"></script>
        <script type="text/javascript" src="/overseer_assets/details_assets/js/personset-jq.js"></script>
<script src="/plugins/SweetAlert/sweetalert.min.js"></script><!--alert插件-->
<script src="/js/jquery.form.js"></script><!--form表单插件-->
<script>
    $(function(){
//提交
    var options={
        beforeSubmit : showRequest,    // 提交前的回调函数
        success : showResponse,    // 提交后的回调函数
        dataType : "json",    // html（默认）、xml、script、json接受服务器端返回的类型
        timeout : 3000    // 限制请求的时间，当请求大于3秒后，跳出请求
    }
    function showRequest(formData, jqForm, options){
        return true;
    }
    function showResponse(responseText,statusText){
            cg_alert_add(responseText,'/admin_overseer/add?ID=<?=$pId?>','/admin_overseer/add?ID=<?=$pId?>');
    }
function cg_alert_add(obj,list_url,add_url){
    if(obj.status == 1){
        swal({
            title: obj.msg,
            confirmButtonText:'继续添加',
            confirmButtonColor: "#DD6B55",
            showCancelButton: true,
            cancelButtonText:'返回列表',
            type: "success",
        },function(isConfirm){
            if (isConfirm) {
                location.href = add_url;
            }else{
                location.href = list_url;
            }
        });
    }else{
        swal(obj.msg,'','error');
    }

}
        $('.btn').each(function(){
            $(this).click(function(){
                var data = $(this).attr('data');
                $('form[data="'+data+'"]').ajaxSubmit(options);
            });
        });
    });
</script>

</body>
</html>
